/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 头部导航栏样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    font-size: 1.8rem;
    color: #1a73e8;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.register-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.logout-btn {
    background-color: #f44336;
    color: white;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.logout-btn:hover {
    background-color: #d32f2f;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* 主搜索区域样式 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.search-container {
    text-align: center;
    margin-bottom: 2rem;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    color: #333;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.slogan {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.search-box {
    display: flex;
    max-width: 700px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

#search-input {
    flex: 1;
    padding: 1.2rem 2rem;
    border: none;
    font-size: 1.1rem;
    outline: none;
    background: transparent;
}

.search-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1.2rem 2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.suggestions {
    max-width: 700px;
    margin: 0.5rem auto 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    display: none;
}

.suggestions.active { display: block; }

.suggestions-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.suggestions-item:hover { background: #f7f9fc; }

.quick-tags {
    max-width: 700px;
    margin: 0.8rem auto 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-tag {
    background: rgba(255,255,255,0.9);
    border: 1px solid #e0e7ff;
    color: #334155;
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.quick-tag:hover { background: #eef2ff; }

.search-meta {
    margin: 0 0 1rem 0;
    color: #666;
}

.result-item { background: #fff; border-radius: 12px; padding: 1rem; border: 1px solid #f0f0f0; }
.result-title a { font-weight: 600; }
.result-snippet mark { background: #fff3cd; padding: 0 2px; }

/* 搜索结果样式 */
.search-results {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.result-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.result-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.result-title a {
    color: #1a73e8;
    text-decoration: none;
}

.result-title a:hover {
    text-decoration: underline;
}

.result-url {
    color: #28a745;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.result-snippet {
    color: #555;
    line-height: 1.5;
}

/* AI回答样式 */
.ai-answer {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.ai-query {
    font-weight: 500;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #1a73e8;
}

.ai-response {
    color: #555;
    line-height: 1.6;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.modal-content .form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.submit-btn {
    width: 100%;
    background-color: #1a73e8;
    color: white;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #1557b0;
}

/* 支付面板样式已移除 */

/* 页脚样式 */
.footer {
    background-color: #333;
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
}

.footer-content p {
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .slogan {
        font-size: 1.5rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-button {
        margin-top: 0.5rem;
    }
    
    .weight-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    #weight-keyword,
    #weight-value {
        width: 100%;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* AI助手悬浮球样式 */
.ai-assistant {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.ai-ball {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.ai-ball:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.ai-icon {
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.ai-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

.ai-chat-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.ai-chat-panel.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.ai-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.ai-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.ai-chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.5);
}

.ai-welcome {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
}

.ai-welcome p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

.ai-message {
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.ai-message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    text-align: right;
}

.ai-message.assistant {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.ai-chat-input {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
}

.ai-chat-input input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 25px;
    outline: none;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.3s ease;
}

.ai-chat-input input:focus {
    border-color: #667eea;
}

#ai-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#ai-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 滚动条样式 */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}
